#!/usr/bin/env python
#coding:utf-8

import os

ls = os.linesep

while 1:

    if os.path.exists(fname):
        print "ERROR: '%s' already exists" % fname
    else:
        break

all = []
print "\nEnter lines ('.' by itself to quit).\n"

while 1:
    entry = raw_input('>')
    if entry == '.':
        break
    else:
        all.apend(entry)

fobj = open(fname, 'w')
fobj.writelines(['%s%s' %(x, ls) for x in all])
fobj.close()
print 'DONE!'
